//
//  ShopCartHeadView.m
//  FKGW
//
//  Created by song ce on 2017/4/17.
//  Copyright © 2017年 song ce. All rights reserved.
//

#import "ShopCartHeadView.h"
#import "UIView+Extend.h"
@implementation ShopCartHeadView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.contentView.backgroundColor = DEF_COLOR242;
    UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    [self addGestureRecognizer:tap];
 
    //店铺名称
    self.shopNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 8, 0, 21)];
    self.shopNameLabel.textColor = DEF_COLOR102;
    self.shopNameLabel.font = [UIFont systemFontOfSize:14];
    [self.shopNameLabel sizeToFit];
    [self addSubview:self.shopNameLabel];
    
    //指示图片
    self.indicatorImageV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_gouwuche_jinru"]];
    self.indicatorImageV.left = self.shopNameLabel.right +5;
    self.indicatorImageV.top  = 10;
    [self addSubview:self.indicatorImageV];
}

-(void)setGroup:(ShopCartGroup *)group{
    _group = group;
    self.shopNameLabel.text = _group.storeName;
    [self.shopNameLabel sizeToFit];
    if(_group.isNotNeedImageV){
        self.indicatorImageV.hidden = YES;
    }
    self.indicatorImageV.left = self.shopNameLabel.right +5;
}

-(void)tap:(UITapGestureRecognizer*)tap{
    if(self.tapBlock){
        self.tapBlock();
    }
}

- (IBAction)editeBtn:(id)sender {
    
    
    
}

@end
